package cn.rongdao.jrkabao.util;

import java.util.Comparator;

import cn.rongdao.jrkabao.bean.cashadvance.SelectBankCardBean;

/**
 * Created by jack on 2017/8/8
 * 按照名字分类方便索引
 */

public class SortByPinyin implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        SelectBankCardBean s1 = (SelectBankCardBean) o1;
        SelectBankCardBean s2 = (SelectBankCardBean) o2;
        if (s1.getPinyinFirst().equals("#")) {
            return 1;
        } else if (s2.getPinyinFirst().equals("#")) {
            return -1;
        }
        return s1.getPinyinFirst().compareTo(s2.getPinyinFirst());
    }
}
